<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page language="java" contentType="text/html; charset=utf-8"
pageEncoding="utf-8" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="x-ua-compatible" content="ie=7" />
    <meta name="Author" content="">
    <title>语轶商务咨询有限公司</title>
    <link href="${pageContext.request.contextPath}/css/css_whir.css" rel="stylesheet" type="text/css" />
    <script src="${pageContext.request.contextPath}/Script/jquery-1.4.2.min.js" type="text/javascript"></script>
<!--[if IE 6]>
<script src="Script/pngAlaph.js"></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->

</head>
<body>
    
    <!--top-->
    <%@ include file="head.jsp"%>
    <!--top End-->
    
    <!--Star-->
    <div class="Body_bg">
    <div class="Banner" style="background:url(${pageContext.request.contextPath}/images/temp/Ban_faq.jpg) no-repeat center top;"><div class="bg"></div></div>
    <div class="Content">  
    
           <!--Sidebar-->
           <div class="Sidebar">
                          <div class="Menu">
                  <h4><img src="${pageContext.request.contextPath}/images/Nav_faq.png" onclick="javascript:location.href='${pageContext.request.contextPath}/faq.jsp'"/></h4>
                  <ul>
                 
                         <li><a id="menu3" href="${pageContext.request.contextPath}/leave/show">我要留言</a></li>
                  </ul>
               </div>
           </div>
           <!--Sidebar End-->
           <!--Right-->
           <div class="RightSidebar">
                <div class="Current">您现在的位置：首页 > 常见问题 > <span>我要留言</span></div>
                <div class="MainContent">
                        <!--Star-->
                        <ul class="Faq_list">
                            <c:forEach items="${pi.list}" var="leaves" varStatus="a">
                                <li>

                                    <h4> <b>${leaves.lname}：</b>${leaves.lcontent}</h4>
                                    <div class="myTxt">
                                        <dl> <b>答：</b>${leaves.lback}</dl>
                                    </div>
                                    <div class="bgEnd"></div>
                                </li>
                            </c:forEach>

                        </ul>
                        <!--Pages-->
                    <%--分页 后台传过来的分页集合为pi即可,路径根据需求修改--%>
                    <div class="Pages" align="center">
                        <span >目前在第<b>${pi.pageNum}</b>页,</span>
                        <span class="p_count">共有<b>${pi.pages}</b>页,</span>
                        <span class="p_total">本页共有<b>${pi.size}</b>条记录</span>
                        <span class="p_page">
                              <a href="${pageContext.request.contextPath}/leave/show?pageNum=1" class="a_first">首页</a>
                           <c:if test="${pi.hasPreviousPage}">
                               <a href="${pageContext.request.contextPath}/leave/show?pageNum=${pi.pageNum-1}" class="a_prev">上一页</a>
                           </c:if>
                            <c:forEach begin="1" end="${pi.pages}" var="index">
                                <c:if test="${pi.pageNum==index}">
                                    <li class="active" style="display: inline;">
                                        <a href="${pageContext.request.contextPath}/leave/show?pageNum=${index}" style=" line-height: 20px;color: black; text-decoration: none;padding: 10px 10px;">${index}</a>
                                    </li>
                                </c:if>
                                <c:if test="${pi.pageNum!=index}">
                                    <li class="" style="display: inline;">
                                        <a href="${pageContext.request.contextPath}/leave/show?pageNum=${index}" style=" line-height: 20px;color: black; text-decoration: none;padding: 10px 10px;">${index}</a>
                                    </li>
                                </c:if>
                            </c:forEach>

                            <c:if test="${pi.hasNextPage}">
                                <a href="${pageContext.request.contextPath}/leave/show?pageNum=${pi.pageNum+1}" class="a_next">下一页</a>
                            </c:if>
                             <a href="${pageContext.request.contextPath}/leave/show?pageNum=${pi.pages}" class="a_end">末页</a>
                          </span>
                    </div>
                    <%-- 分页end--%>
                        <!--Pages-->
                        
                        <!--我要留言-->
                        <div class="Faq_from">
                            <form action="${pageContext.request.contextPath}/leave/setup">
                            <table border="0" cellspacing="0" cellpadding="0" class="My_table">
                                <tr>
                                  <td><input name="lname" type="text" class="text" placeholder="姓名"/></td>
                                </tr>
                                <tr>
                                  <td><input name="lphone" type="text" class="text" placeholder="电话" id="phone"/><span id="sphone"></span></td>
                                </tr>
                                <tr>
                                  <td><input name="lmail" type="text" class="text" placeholder="电子邮件" id="mail"/><span id="smail"></span></td>
                                </tr>
                                <tr>
                                  <td>
                                      <textarea name="lcontent" class="text02" placeholder="內容"></textarea>
                                   </td>
                                </tr>
                                <tr>
                                  <td><input name="" type="submit" value=" " class="btn01" id="submit" disabled/></td>
                                </tr>
                            </table>
                            </form>
                        </div>
                        <!--我要留言 End-->
                    <script>
                        $(function () {
                            $("#phone").keyup(function (){
                                var phone = $("#phone").val();
                                if(phone.length!=11){
                                    $("#sphone").html("请输入11数字的位手机号").css("color","red");
                                    $("#submit").attr("disabled",true);
                                }else {
                                    if(/^1(3|4|5|7|8)\d{9}$/.test(phone)){
                                        $("#sphone").html("");
                                        $("#submit").removeAttr("disabled");
                                    }
                                    else {
                                        $("#sphone").html("号码格式不正确").css("color","red");
                                        $("#submit").attr("disabled",true);


                                    }

                                }
                            });
                            $("#mail").keyup(function (){
                                var mail = $("#mail").val();
                                var isEmail = /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;
                                if(isEmail.test(mail)){
                                    $("#submit").removeAttr("disabled");
                                    $("#smail").html("");
                                }else {
                                    $("#smail").html("邮箱格式不正确！").css("color","red");
                                    $("#submit").attr("disabled","true");
                                }
                            });
                        })
                    </script>
                        <!--End-->
                
                <div class="clear">
                    <c:if test="${not empty mes}">
                        <input type="hidden" id="mes" value="${mes}">
                        <script>
                            var data = $("#mes").val();
                            alert(data)
                        </script>
                    </c:if>
                </div>
                </div>
           </div>
           <!--Right End-->

    <div class="space25"></div>                   
    </div>
    </div>
    <!--End-->
    
    <!--bottom-->
    <%@ include file="tail.jsp"%>

    <!--bottom End-->
    
    <script type="text/javascript" language="javascript">
       jQuery("#nav4").attr("class","onnav");
	   jQuery("#menu3").attr("class","acur");
    </script>
</body>
</html>
